<?php

/*
 * Copyright (C) 2014 University of Pittsburgh
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


abstract class AbstractDAO 
{
  protected $error_info = NULL;
  protected $error_code = 0;
  
  public function __construct() {
    $this->error_code = 0;
    unset($this->error_info);
  }
  
  public function error_code() {
    return $this->error_code;
  }
  
  public function error_info() {
    if(isset($this->error_info)) {
      return $this->error_info;
    } else {
      return NULL;
    }
  }
  
  protected function reset_error() {
    $this->error_code = 0;
    unset($this->error_info);
  }
  
}

?>